<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    body>div{
      width: 100px;
      height: 100px;
      background-color: red;
      overflow: hidden;/*解决与下级元素的粘连问题*/
    }
    div>div{
      width: 50px;
      height: 50px;
      background-color: green;
      /*当元素的上边缘和上级元素的上边缘重叠时，给元素添加上外边距会出现粘连问题
      解决办法:给上级元素添加 overflow:hidden*/
      margin-left: 20px;
      margin-top: 20px;


    }
  </style>
</head>
<body>
<div>
  <div></div>
</div>
</body>
</html>